home *** CD-ROM | disk | FTP | other *** search
/ Gigarom 1 / Gigarom Macintosh Archives (Quantum Leap)(CDRM1080320)(1993).iso / FILES / HYP / C-D / Capt. Midnight Code Ring.cpt / Capt. Midnight Code Ring / card_4003.txt < prev    next >
Text File  |  1989-02-26  |  2KB  |  102 lines

  1. -- card: 4003 from stack: in. Midnight Code Ring
  2. -- bmap block id: 0
  3. -- flags: 4000
  4. -- background id: 3304
  5. -- name: Decoder
  6.  
  7.  
  8. -- part 2 (button)
  9. -- low flags: 00
  10. -- high flags: 8000
  11. -- rect: left=50 top=291 right=336 bottom=92
  12. -- title width / last selected line: 0
  13. -- icon id / first selected line: 9761 / 9761
  14. -- text alignment: 1
  15. -- font id: 0
  16. -- text size: 12
  17. -- style flags: 0
  18. -- line height: 16
  19. -- part name: Crypt
  20. ----- HyperTalk script -----
  21. on mouseUp
  22.   if length(field 2) > 0 then
  23.     put the ticks into start
  24.     put length(field 1) && "characters to process." into message
  25.     set cursor to 4
  26.     put "" into it
  27.     repeat with k = 1 to number of lines in field 2
  28.       put line k of field 2 into key
  29.       put length(key) into x
  30.       repeat with i = 1 to length(field 1)
  31.         put bxor((charToNum(char i of field 1) mod 128), charToNum(char (i mod x) + 1 of key)) into crypt
  32.         if crypt = 0 then put 128 into crypt
  33.         put it & numToChar(crypt) into it
  34.       end repeat
  35.       put it into field 1
  36.       put "" into it
  37.       put length(field 1) && "charcters processed with" && k && "keys in" && (the ticks - start)/60 && "seconds." into msg
  38.     end repeat
  39.   end if
  40.   beep
  41.   wait 5 seconds
  42.   hide msg
  43. end mouseUp
  44.  
  45.  
  46.  
  47. -- part 3 (button)
  48. -- low flags: 00
  49. -- high flags: 8000
  50. -- rect: left=92 top=291 right=336 bottom=134
  51. -- title width / last selected line: 0
  52. -- icon id / first selected line: 1004 / 1004
  53. -- text alignment: 1
  54. -- font id: 0
  55. -- text size: 12
  56. -- style flags: 0
  57. -- line height: 16
  58. -- part name: Get File
  59. ----- HyperTalk script -----
  60. on mouseUp
  61.   put fileName("TEXT") into path
  62.   if path is not empty then
  63.     put "" into field 1
  64.     put " " into it
  65.     open file path
  66.     repeat until it is empty
  67.       read from file path for 16000
  68.       put field 1 & it into field 1
  69.     end repeat
  70.   end if
  71.   close file path
  72. end mouseUp
  73.  
  74.  
  75.  
  76. -- part 4 (button)
  77. -- low flags: 00
  78. -- high flags: 8000
  79. -- rect: left=134 top=291 right=336 bottom=176
  80. -- title width / last selected line: 0
  81. -- icon id / first selected line: 1004 / 1004
  82. -- text alignment: 1
  83. -- font id: 0
  84. -- text size: 12
  85. -- style flags: 0
  86. -- line height: 16
  87. -- part name: Save File
  88. ----- HyperTalk script -----
  89. on mouseUp
  90.   put newFileName("Save in what file?","") into path
  91.   if path is not empty then
  92.     open file path
  93.     write field 1 to file path
  94.   end if
  95.   close file path
  96. end mouseUp
  97.  
  98.  
  99.  
  100. -- part contents for background part 1
  101. ----- text -----
  102. apple